function request(parms) {
	return new Promise(function (resolve, reject){
		uni.request({
			url: parms.url,
			data: parms.data || {},
			header: params.header || {},
			method: parms.method || 'GET',
			dataType: 'json',
			success: function(res) {
				resolve (res.data)
			},
			fail: function(err) {
				//弹窗提示
				uni.showToast({
					title: err || '请求错误',
				})
				reject(err)
			}
		})
	})
}

module.exports = {
	requestApi: request
}